﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZooSystem
{
    public enum type { user, employee, admin }

    [Serializable]
    public class UserData
    {
        public string login;
        public string password;
        public string email;
        public type users_type;

        public UserData(string login, string password, string email)
        {
            this.login = login;
            this.password = password;
            this.email = email;
            this.users_type = type.user;
        }

        static public UserData CreateAdmin() 
        { 
            UserData Admin = new UserData("admin", "admin", "admin@zoo.com");
            Admin.users_type = type.admin;
            return Admin;
        }

        public UserData() { }

        public bool valid_user(UserData obj)
        {
            return this.login == obj.login && this.password == obj.password;
        }
        public bool valid_user(string login, string password)
        {
            return this.login == login && this.password == password;
        }

        public override string ToString()
        {

            return login;
        }

        public string getLogin() { return this.login; }
        public string getPassword() { return this.password; }
        public string getEmail() { return this.login; }
        public string getAddress() { return this.login; }
        public type getUsers_type() { return this.users_type; }
        public void setLogin(string login) { this.login = login; }
        public void setPassword(string password) { this.password = password; }
        public void setEmail(string email) { this.email = email; }
        public void setUsers_type(type users_type) { this.users_type = users_type; }
    }
}
